Lithography becomes more challenging with the continuous shrink in technology nodes. One attempt to meet the increasing requirements has been to use multiple patterning techniques, in which a pattern is built up by using a plurality of masks per layer. At the same time, the reduced spacing or pitch of the features has led to increasing inspection challenges and defection location detection. Optical inspection tools can give a rough position, but are due to their limited resolution not capable of pin-pointing the exact position within an optical image in which a feature is failing. Review-Scanning Electron Microscope (SEM) may be used for further analysis at the optical defect location, but this is a manual process that is highly time consuming and prone to errors. Another technique utilizes E-beam inspection, which also suffers from a low throughput. Thus, there is a need for improved methods for detecting and locating defects.